#include <iostream>
#include <vector>
using namespace std;
using LL=long long;
const int MOD=1e9+7;
int main() {

	int n;
	cin>>n;
	vector<LL> f(n+1),g(n+1);
	
	for(int i=1;i<=n;++i){
		f[i]=(g[i-1]*2%MOD+1)%MOD;
		g[i]=((f[i-1]+(2*g[i-1])%MOD)%MOD+2)%MOD;
	}
	cout<<f[n]<<' '<<g[n]<<endl;
	
	return 0;
}
